Battery charger with buck-boost operation

ABSTRACT

A charging circuit includes an interface connector that may be coupled to a power adapter that provides an input voltage, and a buck-boost charging circuit that receives the input voltage and may be coupled to and may provide an output signal to a battery having a charging voltage. For a given input voltage and a given charging voltage, the buck-boost charging circuit operates in one of a group of modes based on a control signal, where the group of modes comprises: a buck mode, a boost mode and a buck-boost mode. In particular, the charging circuit includes control logic that generates the control signal based on the charging voltage and the input voltage. Thus, the buck-boost charging circuit may operate over a continuous range of input voltages and charging voltages.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority under 35 U.S.C. §119(e) to U.S. Provisional Application Ser. No. 61/875,551, entitled “Universal Power Adapter,” by Yongxuan Hu, Arthur H. Chang, Shimon Elkayan, Collin Conners and Liyu Yang, Attorney Docket Number APL-P20797USP1, filed on Sep. 9, 2013, the contents of which are herein incorporated by reference.

BACKGROUND

1. Field

The described embodiments relate to techniques for controlling an operating mode of a charging circuit associated with a battery. More specifically, the described embodiments relate to techniques for selecting the operating mode of a buck-boost charging circuit based on a charging voltage of the battery and an input voltage received from a power adapter.

2. Related Art

During charging, a portable electronic device is typically connected to a power adapter, which transforms an AC power-line voltage into a DC input voltage that is used to charge the battery. Moreover, many portable electronic devices include a charging circuit that further transforms the DC input voltage prior to charging the battery.

The configuration of the charging circuit and its operation often depend on the DC input voltage and the charging voltage of the battery. However, there are a wide variety of power adapters (with different DC input voltages) and a wide variety of batteries (with different charging voltages). These variations often require more complexity in the charging circuit (with a commensurate increase in size and cost), or require the use of a particular power adapter for a particular portable electronic device, which can be inconvenient for users.

SUMMARY

The described embodiments relate to a charging circuit. This charging circuit includes: an interface connector that may be coupled to a power adapter that provides an input voltage; and a buck-boost charging circuit, coupled to the interface connector, which may be coupled to a battery having a charging voltage and which may provide an output signal to the battery. For a given input voltage and a given charging voltage, the buck-boost charging circuit operates in one of a group of modes based on a control signal, where the group of modes comprises: a buck mode, a boost mode and a buck-boost mode. Furthermore, the charging circuit includes control logic, coupled to the buck-boost charging circuit, which generates the control signals based on the charging voltage and the input voltage.

In particular, the buck-boost charging circuit may operate as a boost circuit when in the boost mode and, if the charging voltage exceeds the input voltage by a predetermined amount (such as when the input voltage is less than a first voltage threshold which is less than the charging voltage), the buck-boost charging circuit may operate in the boost mode and the boost circuit may be selectively coupled to the battery. Moreover, the buck-boost charging circuit may operate as a buck circuit when in the buck mode and, if the charging voltage is less than the input voltage by a predetermined amount (such as when the input voltage is greater than a second voltage threshold which is greater than the charging voltage), the buck-boost charging circuit may operate in the buck mode and the buck circuit may be selectively coupled to the battery.

However, if the charging voltage is greater than the input voltage by less than the first predetermined amount or is less than the input voltage by less than the second predetermined amount (such as when the input voltage is between the first voltage threshold and the second voltage threshold), the buck-boost charging circuit may operate as a buck-boost circuit when in the buck-boost mode that is switchable between a charge configuration and a discharge configuration. In particular, switches in the buck-boost charging circuit may move the buck-boost circuit between the charge configuration and the discharge configuration, respectively, which are selectively coupled to the battery. For example, during a charging time interval two switches in the buck-boost charging circuit may be enabled to place the buck-boost circuit in a charge configuration to charge an inductor, and during a subsequent discharging time interval two other switches in the buck-boost charging circuit may place the buck-boost circuit in a discharge configuration to couple the battery to the inductor and charge the battery with the energy store in the inductor during the first time interval. The control logic may specify a duration of the charging time interval and a duration of the subsequent discharging time interval based on the input voltage and the charging voltage. In some embodiments, the control logic includes a pulse-width modulation circuit.

Additionally, once a mode has been selected, the control logic may change values of the first voltage threshold and/or the second voltage threshold to control the switching points between modes. This hysteresis may prevent mode chattering.

Thus, the buck-boost charging circuit may operate over a continuous range of input voltages and charging voltages. For example, the input voltage may be between 5-20 V, and the charging voltage may be between 6 and 13 V.

Another embodiment provides a charging circuit with the interface circuit and a buck-boost charging circuit that operates in a buck-boost mode in which the buck-boost charging circuit is configured to operate as a buck circuit and to operate as a boost circuit. Moreover, the charging circuit may include a set of switches and may be configured to couple to an inductor. A first switch may selectively couple a first side of the inductor to the interface connector, a second switch may selectively couple the first side of the inductor to ground, a third switch may selectively couple a second side of the inductor to ground, and a fourth switch may selectively couple the second side of the inductor to the battery. During operation of the buck-boost charging circuit, the set of switches may be switched in pairs so that the first switch and the third switch are closed when the second switch and the fourth switch are open (so that the inductor is charged), and the second switch and the fourth switch are closed when the first switch and the third switch are open (so that the inductor is discharged).

Another embodiment provides an electronic device that includes: an integrated circuit; the battery, coupled to the integrated circuit, having the charging voltage; and an embodiment of the charging circuit described above, coupled to the battery.

Another embodiment provides a method for charging the battery, which may be performed by an embodiment of the charging circuit described above. During operation, the charging circuit receives the input voltage from the power adapter. Then, the charging circuit determines the operating mode of the buck-boost charging circuit based on the input voltage and a charging voltage of the battery, where the buck-boost charging circuit provides the output signal to charge the battery, and where, for the given input voltage and the given charging voltage, the buck-boost charging circuit operates in the operating mode in the group of modes. This group of modes comprises: the buck mode, the boost mode and the buck-boost mode. Next, the charging circuit selects the determined operating mode of the buck-boost charging circuit.

This Summary is provided merely for purposes of illustrating some exemplary embodiments, so as to provide a basic understanding of some aspects of the subject matter described herein. Accordingly, it will be appreciated that the above-described features are merely examples and should not be construed to narrow the scope or spirit of the subject matter described herein in any way. Other features, aspects, and advantages of the subject matter described herein will become apparent from the following Detailed Description, Figures, and Claims.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 is a drawing illustrating operating modes of a buck-boost charging circuit in accordance with an embodiment of the present disclosure.

FIG. 2 is a block diagram illustrating a power system in accordance with an embodiment of the present disclosure.

FIG. 3 is a block diagram illustrating a charging circuit in the power system of FIG. 2 accordance with an embodiment of the present disclosure.

FIG. 4 is a block diagram illustrating a control circuit in the control logic in the charging circuit of FIG. 3 in accordance with an embodiment of the present disclosure.

FIG. 5 is a block diagram illustrating a control circuit in the control logic in the charging circuit of FIG. 3 in accordance with an embodiment of the present disclosure.

FIG. 6 is a timing diagram illustrating electrical signals during operation of the charging circuit of FIG. 3 in accordance with an embodiment of the present disclosure.

FIG. 7 is a timing diagram illustrating electrical signals during operation of the charging circuit of FIG. 3 in accordance with an embodiment of the present disclosure.

FIG. 8 is a flowchart illustrating a method for charging a battery using the charging circuit of FIGS. 2 and 3 in accordance with an embodiment of the present disclosure.

FIG. 9 is a block diagram illustrating an electronic device that includes the charging circuit of FIGS. 2 and 3 in accordance with an embodiment of the present disclosure.

Note that like reference numerals refer to corresponding parts throughout the drawings. Moreover, multiple instances of the same part are designated by a common prefix separated from an instance number by a dash.

DETAILED DESCRIPTION

A buck-boost charging circuit that operates over a wide range of input voltages and charging voltages for a battery is described. This charging circuit may receive an input voltage from a power adapter and may provide an output voltage to charge a battery. As described further below with reference to FIGS. 2 and 3, switches in a buck-boost charging circuit in the charging circuit may configure the buck-boost charging circuit to operate in different modes of operation based on the input voltage, the charging voltage and, optionally, the battery voltage. For example, the buck-boost charging circuit may operate as a buck circuit in a buck mode, in which case the buck circuit is coupled to the battery. Moreover, the buck-boost charging circuit may operate as a boost circuit in a boost mode, in which case the boost circuit is coupled to the battery. Furthermore, the buck-boost charging circuit may operate as a buck-boost circuit when in the buck-boost mode that is switchable between a charge configuration and a discharge configuration. In particular, switches in the buck-boost charging circuit may move the buck-boost circuit between the charge configuration and the discharge configuration, respectively, which are selectively coupled to the battery. For example, during a charging time interval two switches in the buck-boost charging circuit may be enabled to place the buck-boost circuit in a charge configuration to charge an inductor, and during a subsequent discharging time interval two other switches in the buck-boost charging circuit may place the buck-boost circuit in a discharge configuration to couple the battery to the inductor and charge the battery with the energy store in the inductor during the first time interval. These different modes of operation of the buck-boost charging circuit are illustrated in FIG. 1.

In particular, for a given charging voltage, there may be three initial ranges (demarcated by a low or first voltage threshold 110-1 and a high or second voltage threshold 112-1) for determining which operating mode is used. The first voltage range is for input voltages higher than high voltage threshold 112-1, in which case the buck-boost charging circuit operates in buck mode 114. The second voltage range is for input voltages lower than low voltage threshold 110-1, in which case the buck-boost charging circuit operates in boost mode 116. And the third voltage range is for input voltages between low voltage threshold 110-1 and high voltage threshold 112-1, in which case the buck-boost charging circuit operates in buck-boost mode 118. Note that low voltage threshold 110-1 and high voltage threshold 112-1 may be selected depending on the charging voltage. For example, for a battery that includes two cells (which is used for purposes of an illustration), low voltage threshold 110-1 may be 6 V and high voltage threshold 112-1 may be 11 V. Alternatively, for a battery that includes three cells (which is used for purposes of another illustration), low voltage threshold 110-1 may be 9 V and high voltage threshold 112-1 may be 15.5 V.

Moreover, the buck-boost charging circuit may change modes if the input voltage changes. In some instances, the mode may change if the input voltage crosses either low voltage threshold 110-1 or high voltage threshold 112-1 (e.g., the mode may switch from boost mode 116 to buck-boost mode 118 when the input voltage increases from below low voltage threshold 110-1 to above low voltage threshold 110-1). However, as illustrated in FIG. 1, in other instances the input voltage may need to cross a dynamic voltage threshold before the mode switches. For example, once the buck-boost charging circuit is in the buck mode, high voltage threshold 112-2 may be lower than an initial value of high voltage threshold 112-1, and the mode will not switch from buck mode 114 to buck-boost mode 118 until the input voltage falls below high voltage threshold 112-2. Similarly, once the buck-boost charging circuit is in boost mode 116, there may be a low voltage threshold 110-2 that is higher than an initial value of low voltage threshold 110-1. And once the buck-boost charging circuit is in buck-boost mode 118, there may be a high voltage threshold 112-3 higher than the initial value of high voltage threshold 112-1 and a low voltage threshold 110-3 lower than an initial value of low voltage threshold 110-1. For example, the dynamic voltage thresholds may represent a 5 or 10% increase or decrease in the initial values of voltage thresholds 110-1 and 112-1. Thus, the initial values of voltage thresholds 110-1 and 112-1 may be dynamically adapted after the buck-boost charging circuit is in one of the modes. This hysteresis, which may be implemented using dynamic voltage thresholds, may minimize frequent (and potentially-wasteful) mode switching if the input voltage is hovering around either the initial values of low voltage threshold 110-1 or high voltage threshold 112-1. Note that in other embodiments voltage thresholds 110 and 112 are static and, thus, may not change as the buck-boost charging circuit switches between modes. In addition, note that voltage thresholds 110 and 112 may reset, such as when the power adapter is disconnected and reconnected, or when the power supply is cycled off and on.

FIG. 2 presents a block diagram illustrating a power system 200. This power system may include: power adapter 210, charging circuit 214, switch 228 and battery 230. Moreover, charging circuit 214 may include: interface connector 216, buck-boost charging circuit 218 and control logic 220. Furthermore, buck-boost charging circuit 218 may include switches 224 and inductor 232. The switches may comprise a first switch 224-1 that may selectively couple a first side of the inductor 232 to the interface connector 216, a second switch 224-2 that may selectively couple the first side of the inductor 232 to ground, a third switch 224-3 that may selectively couple a second side of the inductor 232 to ground, and a fourth switch 224-4 that may selectively provide the output signal 226 to a battery and/or a system load. For example, the fourth switch 224-4 may selectively couple the second side of the inductor 232 to battery 230 (although it should be appreciated that switch 228 or another element may selectively control the connection between the second side of the inductor 232 to battery 230). Note that power adapter 210 may be configured to receive AC power by coupling to an AC power line provided by an electrical power grid and may convert AC electrical signals to DC electrical signals. Moreover, power adapter 210 may use include a full-bridge rectifier, a half-bridge rectifier and/or a fly-back converter circuit to perform the conversion. In addition, note that battery 230 may include one or more cells or one or more battery packs, and that battery 230 may have a charging voltage (e.g., a voltage set by power system 200 at which battery 230 will be charged). However, battery 214 is not limited to a particular construction.

During operation of power system 200, power adapter 210 provides an input signal 212 having an input voltage to interface connector 216 via a cable having one or more signal lines. Then, interface connector 216 provides input signal 212 to buck-boost charging circuit 218 and control logic 220. As described previously, based on the input voltage and the charging voltage, control logic 220 may select an operating mode (or the mode) of buck-boost charging circuit 218 from a group of modes, which may include (but is not limited to): a buck mode, a boost mode and a buck-boost mode. In particular, control logic 220 may generate one or more control signals 222 based on the input voltage and the charging voltage (and/or the battery voltage). These control signals may specify switching states (such as open or closed) of switches (Q) 224 (such as field-effect transistors or FETs) to select the operating mode. Moreover, buck-boost charging circuit 218 may output or provide output signal 226 (such as a charging signal) to battery 230 to charge battery 230 and/or a device load to power an electronic device that includes power system 200. As shown in FIG. 2, control logic 220 may control the switching state of switch 228 (such as a field-effect transistor or a FET) to gate when battery 230 is charged (such as when power adapter 210 and/or buck-boost charging circuit 218 are appropriately configured for operation).

Thus, at a given time, buck-boost charging circuit 218 operates in a mode selected from the group of modes. For example, selection of mode (and the resulting one or more control signals 222 which may implement the mode) may be based on whether the input voltage is higher or lower than the charging voltage (and/or the battery voltage). In particular, buck-boost charging circuit 218 may include (or, using switches 224, may be configured to operate as) a boost circuit when in the boost mode and, if the charging voltage exceeds the input voltage by a predetermined amount (such as when the input voltage less than a first voltage threshold as described above with respect to FIG. 1), buck-boost charging circuit 218 may operate in the boost mode and the boost circuit may be selectively coupled to battery 230. To operate the buck-boost charging circuit 218 in the boost mode, the one or more control signals 222 may close first switch 224-1 and may open second switch 224-2 (i.e., first switch 224-1 is on and second switch 224-2 is off). Then, charging circuit 214 may perform DC-to-DC power conversion on input signal 212 to generate output signal 226. During this power conversion, third and fourth switches 224-3 and 224-4 may alternately switch (so that third switch 224-3 is on when fourth switch 224-4 is off, and vice versa) based on the one or more control signals 222. For example, third and fourth switches 224-3 and 224-4 may be switched at a switching frequency. In some examples, the switching frequency may be between 100 KHz and 2 MHz, although it should be appreciated that the switching frequency may be set to any value as appropriate. (For example, the switching may be at a frequency between 10 kHz and 10 MHz depending on the size of inductor 232 in charging circuit 214 and/or acceptable switching losses.) This switched-mode power conversion may allow more power at the appropriate charging voltage (and based on the capabilities of power adapter 210) to be provided to battery 230 when power adapter 210 provides input signal 212 having a lower input voltage than the charging voltage.

Moreover, buck-boost charging circuit 218 may include (or, using switches 224, may be configured to operate as) a buck circuit when in the buck mode and, if the charging voltage is less than the input voltage by a predetermined amount (such as when the input voltage greater than a second voltage threshold such as discussed in more detail above with respect to FIG. 1, which may occur when power adapter 210 is a so-called ‘high-voltage’ power adapter), buck-boost charging circuit 218 may operate in the buck mode and the buck circuit may be selectively coupled to battery 230. To operate the buck-boost charging circuit 218 in a buck mode, the one or more control signals 222 may open third switch 224-3 and may close fourth switch 224-4 (i.e., third switch 224-3 is off and fourth switch 224-4 is on). Then, charging circuit 214 may perform DC-to-DC power conversion on input signal 212 to generate output signal 226. During this power conversion, first and second switches 224-1 and 224-2 may alternately switch based on the one or more control signals 222 (so that first switch 224-1 is on when second switch 224-2 is off, and vice versa). For example, first and second switches 224-1 and 224-2 may be switched at a switching frequency. In some examples, the switching frequency may be between 100 KHz and 2 MHz, although it should be appreciated that the switching frequency may be set to any value as appropriate. This switched-mode power conversion may also allow more power at the appropriate charging voltage (and based on the capabilities of power adapter 210) to be provided to battery 230 when power adapter 210 is current-limited (which, in turn, may facilitate or enable power adapter 210 to be more compact).

However, if the charging voltage is greater than the input voltage by less than a first predetermined amount or is less than the input voltage by less than a second predetermined amount (such as when the input voltage is between the first voltage threshold and the second voltage threshold as discussed above), buck-boost charging circuit 218 may operate a buck-boost circuit having a charge configuration and a discharge configuration in the buck-boost mode, which may be selectively coupled to battery 230. For example, as described further below with reference to FIGS. 6 and 7, switches 224 in buck-boost charging circuit 218 may switch the buck-boost charging circuit 218 between the charge configuration and the discharge configuration, respectively, which are selectively coupled to battery 230. In particular, during a first charging time interval first and third switches 224-1 and 224-3 in buck-boost charging circuit 218 may be enabled to charge inductor 232, and during a subsequent second discharging time interval second and fourth switches 224-2 and 224-4 in buck-boost charging circuit 218 may be coupled to battery 230 and charge battery 230 with the energy store in inductor 232 during the first time interval. Moreover, as described further below with reference to FIGS. 4 and 5, buck-boost charging circuit 118 may perform DC-to-DC power conversion on input signal 212 to generate output signal 226 by alternately switching between the charge configuration and the discharge configuration. This alternating pairwise switching of switches 224 based on the one or more control signals 222 may occur at any suitable switching frequency, for example between 100 kHz and 2 MHz (which, once again, is provided as an illustration and is not intended to be limiting). This switched-mode power conversion may also allow more power at the appropriate charging voltage (and based on the capabilities of power adapter 210) to be provided to battery 230.

Note that control logic 220 may specify a duration of the charging time interval and a duration of the subsequent discharging time interval based on the input voltage and the charging voltage. In particular, the amounts of time spent in each configuration in the buck-boost mode may be dependent on the input voltage and the charging voltage. When the input voltage equals the charging voltage, the two time intervals are equal, and buck-boost charging circuit 218 may spend equal time operating in the inductor-charging configuration and in the inductor-discharging configuration. Moreover, when the input voltage is higher than the charging voltage, buck-boost charging circuit 218 spends more time in the discharge configuration. Conversely, when the input voltage is lower than the charging voltage, buck-boost charging circuit 218 spends more time in the charge configuration. As described further below with reference to FIGS. 4 and 5, in some embodiments, control logic 220 includes a pulse-width modulation (PWM) circuit. However, other types of modulation (such as amplitude modulation or sigma-delta modulation) or control techniques may be used.

Additionally, as described previously, after providing the one or more control signals 222 that specify the mode, control logic 220 may change values of the first voltage threshold and the second voltage threshold. This hysteresis (or the use of dynamic voltage thresholds) may prevent mode chattering.

Thus, buck-boost charging circuit 218 may operate over a continuous range of input voltages and charging voltages. For example, the input voltage may be between 5-20 V, and the charging voltage may be between 6 and 8.7 V for a two-cell battery and between 9 and 13.05 V for a three-cell battery. Consequently, the input voltage may be compatible with a universal serial bus (such as approximately 5 V) and the charging voltage may be between 6 and 9 V. However, it should be understood that these numerical values are for purposes of illustration only, and that other battery configurations, input voltages and/or charging voltages may be used.

In some embodiments, when interface connector 216 is de-coupled from power adapter 210, buck-boost charging circuit 218 may be placed in the boost-mode configuration. This may ensure that charging circuit 214 reverts to an operating mode that initially expects input signal 212 to have a low input voltage (approximately 5V) if and when charging circuit 214 is re-coupled to power adapter 210. However, in some embodiments, while charging circuit 214 defaults to the boost mode, it does not operate until power adapter 210 is connected or coupled to interface connector 216. Alternatively, even after power adapter 210 is connected or coupled to interface connector 216, charging circuit 214 may not operate until handshaking or communication of information with power adapter 210 occurs. In particular, in embodiments where power adapter 210 can be configured, the information received from power adapter 210 may include the input voltage and when power adapter 210 is ready to charge battery 230 from power adapter 210, and the information provided to power adapter 210 may include the charging voltage and/or the operating mode. This information may allow power adapter 210 and/or charging circuit 214 to be configured and may synchronize their operation. However, operation of power adapter 210 and/or charging circuit 214 may or may not involve communication of the information between power adapter 210 and charging circuit 214.

In addition, as noted previously, for a given battery and a given power adapter, buck-boost charging circuit 218 may operate in a mode selected from the group of modes that includes (but is not limited to): the boost mode, the buck mode and the buck-boost mode (e.g., in some ranges of the input voltage and/or the charging voltage there may be other types of modes or operating modes). Thus, the configuration of buck-boost charging circuit 218 described above may occur when power adapter 210 is coupled or de-coupled from interface connector 216, when the input voltage changes and/or in the event that a thermal limit is reached (e.g., if charging circuit 214 shuts down, buck-boost charging circuit 218 may be placed in the boost-mode configuration).

By facilitating configuration of buck-boost charging circuit 218, the charging technique may allow more flexible use of different power adapters and may allow more compact and lower cost power adapters. Consequently, the charging technique may reduce user frustration and may improve the overall user experience when using electronic devices that include power sources, such as batteries, which need to be routinely recharged.

We now describe exemplary embodiments of the charging circuit and its operation. Portable electronic devices (such as smartphones, tablets and laptops) are increasingly important in people's daily lives. The battery charger (i.e., the charging circuit) in portable electronic devices enables these portable electronic devices to function by maintaining charge in a battery.

While a wide variety of battery types and configurations may be used in conjunction with the charging circuit described above, lithium-ion batteries are used as an illustrative example in the following discussion. Lithium-ion batteries are widely used in portable electronic devices because of their high energy density, long cycle life and the absence of memory effects. For example, the lithium-ion battery pack (i.e., the battery) used in laptop computers often includes two or three battery cells in series. Typically, a power adapter converts the 110 or 220 V AC power-line voltage to the input source voltage (or input voltage) for the battery charger. For laptop computers, the input voltage to the charging circuit from the power adapter is usually in the range of 10-20 V (such as 12 or 15 V). Alternatively, because of the popularity of the universal-serial-bus interface, the input voltage may be 5 V. Note that the aforementioned numerical values are for purposes of illustration only, and other values may be used for different power adapters, batteries and/or system requirements.

FIG. 3 presents a block diagram of a charging circuit 300, in which the input voltage is received at input node 310 and output voltage to the battery is output at output node 312. For some batteries (e.g., such as some two-cell configurations, the battery-pack voltage may be between 6 and 8.7 V (i.e., the battery pack may experience a range of voltages during operation). In some instances, charging circuit 300 may be configured to connect to power adapters that provide input voltages that are either less than the lowest battery pack voltage (e.g., 5 V when the battery voltage is between 6 and 8.7 V) or greater than the highest battery pack voltage (e.g., 12 or 15 V when the battery voltage is between 6 and 8.7 V). As described previously, buck-boost charging circuit 218 may operate in a buck mode and a boost mode. Therefore, buck-boost charging circuit 218 can take or operate using the input voltages in the preceding examples. Moreover, in these examples it is not necessary for buck-boost charging circuit 218 to operate continuously from the buck mode to the boost mode (and vice versa) over the full range of possible input voltages because the 6 to 8.7 V battery-pack voltage is always lower than the input voltage, or always higher than the input voltage.

However, for some three-cell configurations, the battery-pack voltage may be between 9 and 13.05 V (i.e., the battery pack may experience a range of voltages during operation). If power adapter 210 provides an input voltage of 12 V, such as in the example discussed above, to charging circuit 214, this is inside the 9 to 13.05 V range. Moreover, if buck-boost charging circuit 218 had only the buck mode and the boost mode, it would not be able to charge a three-cell battery back from 9 to 13.05 V without interruption (e.g., using only the buck mode and the boost mode it may not be possible to operate over the ranges of the input voltage and the battery-pack voltage). Instead, the buck-boost mode may be used. Thus, in the buck-boost mode, during the ON-time first and third switches 224-1 and 224-3 are on (or closed), and second and fourth switches 224-2 and 224-4 are off (or open) so that energy is transferred from power adapter 210 to inductor 232 in the charge configuration. Moreover, during the OFF-time, first and third switches 224-1 and 224-3 are off, and second and fourth switches 224-2 and 224-4 are on so that energy is transferred from inductor 232 to the charger-circuit output capacitor and the load in the discharge configuration. Note that in an exemplary embodiment, inductor 232 (FIGS. 2 and 3) has an inductance of approximately 1-10 μH and Rw is approximately 100 kΩ.

FIGS. 4 and 5 present block diagrams of one embodiment of the control logic which may be used to control the switching of switches 224 (FIGS. 2 and 3) to operate the charging circuit in the buck-boost mode (and, thus, is one manner in which the operation of the buck-boost charging circuit may be controlled). In particular, these embodiments illustrate a ripple-based control with an emulated-inductor current as the ramp signal (which is used to generate control signals 222 in FIG. 2, i.e., the pulses for switches 224). The rising ramp is designed to be proportional to the voltage across inductor 232 (FIGS. 2 and 3) during the ON-time, and the falling ramp is designed to be proportional to the voltage across inductor 232 (FIGS. 2 and 3) during the OFF-time. In this way, the emulated signal is proportional to the inductor current. A voltage window of Vw is created around the control voltage Vc (the output from an error amplifier that integrates the error between feedback and a reference setting in control loop for the charging circuit), which is shown below in FIG. 5. The higher limit of the window (Vh) is Vc plus 0.5·Vw (as is also shown below in FIG. 5), and the lower limit (Vl) is Vc minus 0.5·Vw. Then, the ramp signal is compared to Vh and Vl to determine the ON-time and the OFF-time (which is similar to the peak-valley current mode control). When the rising slope of the ramp signal reaches Vh, the ON-time is terminated; and when the falling edge of the ramp signal reaches Vl, the OFF-time is terminated.

FIG. 4 shows a control circuit 400 in control logic 220 (FIGS. 2 and 3) that generates the emulated-inductor-current ramp signal. In FIG. 4, Vref is a voltage level coupled to a current-controlled voltage source. The voltage difference between V_R (the emulated-inductor-current ramp signal) and Vref creates a current to flow through a resistor Rr, and this current and the inductor-current ripple adjusts Vw.

During t₁ (equal to D·Ts) in control circuit 400, switch S9 is off and switch S10 is on. The voltage change rate of V_R is gm·CSIN/Cr, where gm is the gain of transconductance amplifiers 410 and 412 and CSIN is the input voltage of the charging circuit (which is sometimes referred to as Vin). Moreover, the rising ramp of V_R is proportional to the voltage across inductor 232 (FIGS. 2 and 3) during the ON-time. During t₂ (equal to D′·Ts), switch S9 is on and switch S10 is off. The voltage change rate of V_R is gm·(−CSON)/Cr, where CSON is the output voltage of the charging circuit (which is sometimes referred to as Vout) and Cr is a capacitor value. Note that the falling ramp of V_R is proportional to the voltage across inductor 232 (FIGS. 2 and 3) during the OFF-time.

Furthermore, control logic 500 shown in FIG. 5 in control logic 220 (FIGS. 2 and 3) produces a window size of Vw (equal to Vh minus Vl) of gm·Rw·Vin·Vout/(Vin+Vout), where Rw is a resistor value. With this window size, the ON-time t₁ equals D·Rw·Cr and the OFF-time t₂ equals D′·Rw·Cr. (Note that Vin/Vout equals D′/D.) Therefore, the switching period Ts (equal to t₁+t₂) is (D+D′)·Rw·Cr or Rw·Cr and the switching frequency fsw (equal to 1/Ts) is 1/(Rw·Cr). Note that the switching frequency only depends on the resistor value Rw and the capacitor value Cr so the switching frequency does not change even if the input voltage and the output voltage have a wide range. (Also note that the thresholds for the control logic changing between the modes in the group of modes have initial values. After a given mode is selected, these boundaries or thresholds are expanded. This hysteresis reduces mode chattering or mode switching.) In FIG. 5, note that transconductance amplifiers are denoted by ‘gm,’ while buffers are denoted by ‘b.’ Moreover, ‘L.O.’ indicates a logarithmic operation and ‘E.O.’ indicates an exponential operation.

FIG. 6 presents a drawing of electrical signals during operation of the charging circuit in the buck-boost mode in which the input voltage is 11 V and the output voltage is 8.4 V (which are used for purposes of illustration), when configured to operate as the buck circuit (Vin greater than Vout), during the ON-time first and third switches 224-1 and 224-3 in FIGS. 2 and 3 are on and second and fourth switches 224-2 and 224-4 in FIGS. 2 and 3 are off. Thus, when Vin is greater than Vout, the ramp-up time is less than the ramp-down time because less time is needed to charge inductor 232 in FIGS. 2 and 3). Note that switches 224 (FIGS. 2 and 3) are switched in pairs even in the buck-boost mode. In the buck-boost mode all four of switches 224 (FIGS. 2 and 3) are active versus a given pair of switches 224 (FIGS. 2 and 3) in either the buck mode or the boost mode (i.e., the buck-boost charging circuit operates as both the buck circuit and the boost circuit in the buck-boost mode).

Furthermore, as shown in FIG. 7, which presents a drawing of electrical signals during operation of the charging circuit in the buck-boost mode in which the input voltage is 5 V and the output voltage is 8.4 V (which are used for purposes of illustration), when configured to operate as the boost circuit (Vin less than Vout), during the OFF-time first and third switches 224-1 and 224-3 in FIGS. 2 and 3 are off and second and fourth switches 224-2 and 224-4 in FIGS. 2 and 3 are on. Thus, when Vin is less than Vout, the ramp-up time is greater than the ramp-down time because more time needed to charge inductor 232 in FIGS. 2 and 3).

As noted previously, the control technique also is capable of separate buck-mode operation and boost-mode operation. In the buck mode, during t1 (equal to D·Ts), switches S9 and S10 are on, and the voltage change rate of V_R is gm·(Vin−Vout)/Cr. During t₂ (equal to D′·Ts), switch S9 is on and switch S10 is off, and the voltage change rate of V_R is gm·(−Vout)/Cr. If Vw is gm·D·(Vin−Vout)·Rw, t₁ is D·Rw·Cr, t₂ is D′·Rw·Cr, Ts is Rw·Cr, and the switching frequency fsw is 1/(Rw·Cr). Similarly, in the boost mode, during t1 (equal to D·Ts), switch S9 is off and switch S10 is on, and the voltage change rate of V_R is gm·Vin/Cr. During t₂ (equal to D′·Ts), switches S9 and S10 are on, and the voltage change rate of V_R is gm·(Vin−Vout)/Cr. If Vw is gm·D′·(Vout−Vin)·Rw, t₁ is D·Rw·Cr, t₂ is D′·Rw·Cr, Ts is Rw·Cr, and the switching frequency fsw is 1/(Rw·Cr). This capability may be useful with an input voltage such as 15 V because a separate buck mode of operation can save switching loss (only two of switches 224 in FIGS. 2 and 3 are switching as opposed to four switches). Similarly, with an input voltage such as 5 V, a separate boost mode of operation can save switching loss (once again because only two of switches 224 in FIGS. 2 and 3 are switching as opposed to four switches).

We now describe embodiments of a method. FIG. 8 presents a flowchart illustrating a method 800 for charging a battery, which can be performed using a charging circuit (such as charging circuit 214 in FIG. 2 or charging circuit 300 in FIG. 3). During operation, the charging circuit receives an input voltage (operation 810) from a power adapter. Then, the charging circuit determines an operating mode of a buck-boost charging circuit (operation 812) based on the input voltage and a charging voltage of the battery, where the buck-boost charging circuit provides an output signal to charge the battery, and where, for a given input voltage and a given charging voltage, the buck-boost charging circuit operates in the operating mode in a group of modes. This group of modes comprises: a buck mode, a boost mode and a buck-boost mode. Next, the charging circuit selects the determined operating mode (operation 814) of the buck-boost charging circuit.

In some embodiments of method 800, there may be additional or fewer operations. Moreover, the order of the operations may be changed, and/or two or more operations may be combined into a single operation. For example, the operating mode may be determined based on the charging voltage and information (such as a voltage or a resistance) received via one or more data signal lines coupled to the power adapter instead of or in addition to being based on the input voltage. This information may specify whether or not the power adapter can provide the charging voltage. Alternatively or additionally, the operating mode may be determined based on the input voltage, the charging voltage and/or the battery voltage.

An embodiment of the charging circuit may be used in an electronic device. This is shown in FIG. 9, which presents a block diagram illustrating an electronic device 900 that includes a charging circuit 910, such as charging circuit 214 (FIG. 2) or 300 (FIG. 3), and a battery 912.

In general, functions of the embodiments of the charging circuit may be implemented in hardware and/or in software. Thus, electronic device 900 may include one or more program modules or sets of instructions stored in an optional memory subsystem 914 (such as DRAM or another type of volatile or non-volatile computer-readable memory), which may be executed by an optional processing subsystem 916 (which includes one or more integrated circuits). (In general, the charging technique may be implemented more in hardware and less in software, or less in hardware and more in software, as is known in the art.) Note that the one or more computer programs may constitute a computer-program mechanism. Furthermore, instructions in the various modules in optional memory subsystem 914 may be implemented in: a high-level procedural language, an object-oriented programming language, and/or in an assembly or machine language. Note that the programming language may be compiled or interpreted, e.g., configurable or configured, to be executed by the processing subsystem.

Components in charging circuit 214 (FIG. 2), charging circuit 300 (FIG. 3) and electronic device 900 may be coupled by signal lines, links or buses. While electrical communication has been used as an illustrative example, in general these connections may include electrical, optical, or electro-optical communication of signals and/or data. Furthermore, in the preceding embodiments, some components are shown directly connected to one another, while others are shown connected via intermediate components. In each instance the method of interconnection, or ‘coupling,’ establishes some desired communication between two or more circuit nodes, or terminals. Such coupling may often be accomplished using a number of circuit configurations, as will be understood by those of skill in the art (e.g., AC coupling and/or DC coupling may be used).

In some embodiments, functionality in these circuits, components and devices may be implemented in one or more: application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), and/or one or more digital signal processors (DSPs). Moreover, the circuits and components may be implemented using any combination of analog and/or digital circuitry, including: bipolar, PMOS and/or NMOS gates or transistors. Furthermore, signals in these embodiments may include digital signals that have approximately discrete values and/or analog signals that have continuous values. Additionally, components and circuits may be single-ended or differential, and power supplies may be unipolar or bipolar.

An output of a process for designing an integrated circuit, or a portion of an integrated circuit, comprising one or more of the circuits described herein may be a computer-readable medium such as, for example, a magnetic tape or an optical or magnetic disk. The computer-readable medium may be encoded with data structures or other information describing circuitry that may be physically instantiated as an integrated circuit or portion of an integrated circuit. Although various formats may be used for such encoding, these data structures are commonly written in: Caltech Intermediate Format (CIF), Calma GDS II Stream Format (GDSII) or Electronic Design Interchange Format (EDIF). Those of skill in the art of integrated circuit design can develop such data structures from schematics of the type detailed above and the corresponding descriptions and encode the data structures on a computer-readable medium. Those of skill in the art of integrated circuit fabrication can use such encoded data to fabricate integrated circuits comprising one or more of the circuits described herein.

Electronic device 900 may include one of a variety of devices that can include a power source (such as a battery) and/or a power supply, including: a desktop computer, a server, a laptop computer, a media player (such as an MP3 player), an appliance, a subnotebook/netbook, a tablet computer, a smartphone, a cellular telephone, a network appliance, a set-top box, a personal digital assistant (PDA), a toy, a controller, a digital signal processor, a game console, a device controller, a computational engine within an appliance, a consumer-electronic device, a portable computing device or a portable electronic device, a personal organizer, and/or another electronic device.

Although we use specific components to describe charging circuit 214 (FIG. 2), charging circuit 300 (FIG. 3) and electronic device 900, in alternative embodiments different components and/or subsystems may be used. Additionally, one or more of the components may not be present in one or more of these embodiments. For example, inductor 232 (FIGS. 2 and 3) may be an external component or may be an integrated component. In some embodiments, charging circuit 214 (FIG. 2), charging circuit 300 (FIG. 3) and electronic device 900 include one or more additional components that are not shown. For example, the charging circuit may be implemented in an integrated circuit. Moreover, while FIGS. 2 and 3 illustrate a single-stage charging circuit, in other embodiments the charging circuit includes multiple stages. In addition, while FIGS. 2 and 3 illustrate a non-inverting, full-switch buck-boost charging circuit, in other embodiments one or more of a wide variety of different charging circuits are used. Also, although separate components are shown in the preceding embodiments, in some embodiments some or all of a given component can be integrated into one or more of the other components and/or positions of components can be changed. Note that control logic 220 (FIG. 2) may be pre-programmed with the charging voltage of battery 230 (FIG. 2), so that the signal line that conveys output signal 226 may not need to be coupled to control logic 220 (as shown in FIG. 2). Similarly, the input voltage may be provided by interface connector 216 (FIG. 2) to control logic 220 (FIG. 2), so that the signal line that conveys input signal 212 may not need to be coupled to control logic 220 (as shown in FIG. 2).

In the preceding description, we refer to ‘some embodiments.’ Note that ‘some embodiments’ describes a subset of all of the possible embodiments, but does not always specify the same subset of embodiments.

The foregoing description is intended to enable any person skilled in the art to make and use the disclosure, and is provided in the context of a particular application and its requirements. Moreover, the foregoing descriptions of embodiments of the present disclosure have been presented for purposes of illustration and description only. They are not intended to be exhaustive or to limit the present disclosure to the forms disclosed. Accordingly, many modifications and variations will be apparent to practitioners skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present disclosure. Additionally, the discussion of the preceding embodiments is not intended to limit the present disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein. 

What is claimed is:
 1. A charging circuit, comprising: an interface connector configured to couple to a power adapter that provides an input voltage; a buck-boost charging circuit coupled to the interface connector, and configured to couple to a battery having a charging voltage and to provide an output signal to the battery, wherein, for a given input voltage and a given charging voltage, the buck-boost charging circuit is configured to operate in one of a group of modes based on a control signal, wherein the group of modes comprises: a buck mode, a boost mode and a buck-boost mode; and control logic, coupled to the buck-boost charging circuit, configured to generate the control signal based on the charging voltage and the input voltage.
 2. The charging circuit of claim 1, wherein the buck-boost charging circuit operates as a boost circuit when in the boost mode; and wherein, if the charging voltage exceeds the input voltage by a predetermined amount, the buck-boost charging circuit operates in the boost mode and the boost circuit is selectively coupled to the battery.
 3. The charging circuit of claim 1, wherein the buck-boost charging circuit operates as a buck circuit when in the buck mode; and wherein, if the charging voltage is less than the input voltage by a predetermined amount, the buck-boost charging circuit operates in the buck mode and the buck circuit is selectively coupled to the battery.
 4. The charging circuit of claim 1, wherein the buck-boost charging circuit operates as a boost circuit and a buck circuit when in the buck-boost mode; and wherein, if the charging voltage is one of greater than the input voltage by less than a first predetermined amount and less than the input voltage by less than a second predetermined amount, the buck-boost charging circuit operates in the buck-boost mode and the boost circuit and the buck circuit are selectively coupled to the battery.
 5. The charging circuit of claim 4, wherein, during a time interval, the buck-boost charging circuit operates as a buck circuit, which is coupled to the battery; and wherein, during a subsequent time interval, the buck-boost charging circuit operates as a boost circuit, which is coupled to the battery.
 6. The charging circuit of claim 5, further comprising control logic configured to specify a duration of the time interval and a duration of the subsequent time interval based on the input voltage and the charging voltage.
 7. The charging circuit of claim 6, wherein the control logic includes a pulse-width modulation circuit.
 8. The charging circuit of claim 1, wherein the buck-boost charging circuit is configured to operate over a continuous range of input voltages and charging voltages.
 9. The charging circuit of claim 1, wherein, for the input voltage less than a first voltage threshold, the buck-boost charging circuit operates as a boost circuit when in the boost mode and the boost circuit is selectively coupled to the battery; wherein, for the input voltage greater than a second voltage threshold, the buck-boost charging circuit operates as a buck circuit when in the buck mode and the buck circuit is selectively coupled to the battery; and wherein, for the input voltage between the first voltage threshold and the second voltage threshold, the buck-boost charging circuit operates as the buck circuit and the boost circuit when in the buck-boost mode and the buck circuit and the boost circuit are selectively coupled to the battery.
 10. The charging circuit of claim 9, wherein, after providing the control signal that specifies the mode, the control logic is configured to change initial values of the first voltage threshold and the second voltage threshold to prevent mode chattering.
 11. The charging circuit of claim 1, wherein the input voltage is between 5-20 V; and wherein the charging voltage is between 6 and 13 V.
 12. A charging circuit, comprising: an interface connector configured to couple to a power adapter that provides an input voltage; a buck-boost charging circuit coupled to the interface connector, and configured to couple to a battery having a charging voltage and to provide an output signal to the battery, wherein the buck-boost charging circuit is configured to operate in a buck-boost mode in which the buck-boost charging circuit operates as a buck circuit and operates as a boost circuit.
 13. The charging circuit of claim 12, wherein the charging circuit further includes a set of switches and is configured to couple to an inductor; wherein a first switch selectively couples a first side of the inductor to the interface connector, a second switch selectively couples the first side of the inductor to ground, a third switch selectively couples a second side of the inductor to ground, and a fourth switch selectively couples the second side of the inductor to the battery; and wherein, during operation of the buck-boost charging circuit, the set of switches are switched in pairs so that the first switch and the third switch are closed when the second switch and the fourth switch are open, and the second switch and the fourth switch are closed when the first switch and the third switch are open.
 14. An electronic device, comprising: an integrated circuit; a battery, coupled to the integrated circuit, having a charging voltage; and a charging circuit, coupled to the battery, wherein the charging circuit includes: an interface connector configured to couple to a power adapter that provides an input voltage; a buck-boost charging circuit coupled to the interface connector, and configured to couple to battery having a charging voltage and to provide an output signal to the battery, wherein, for a given input voltage and a given charging voltage, the buck-boost charging circuit is configured to operate in one of a group of modes based on a control signal, wherein the group of modes comprises: a buck mode, a boost mode and a buck-boost mode; and control logic, coupled to the buck-boost charging circuit, configured to generate the control signal based on the charging voltage and the input voltage.
 15. The electronic device of claim 14, wherein the buck-boost charging circuit operates as a boost circuit when in the boost mode; and wherein, if the charging voltage exceeds the input voltage by a predetermined amount, the buck-boost charging circuit operates in the boost mode and the boost circuit is selectively coupled to the battery.
 16. The electronic device of claim 14, wherein the buck-boost charging circuit operates as a buck circuit when in the buck mode; and wherein, if the charging voltage is less than the input voltage by a predetermined amount, the buck-boost charging circuit operates in the buck mode and the buck circuit is selectively coupled to the battery.
 17. The electronic device of claim 14, wherein the buck-boost charging circuit operates as a boost circuit and a buck circuit when in the buck-boost mode; and wherein, if the charging voltage is one of greater than the input voltage by less than a first predetermined amount and less than the input voltage by less than a second predetermined amount, the buck-boost charging circuit operates in the buck-boost mode and the boost circuit and the buck circuit are selectively coupled to the battery.
 18. The electronic device of claim 17, wherein, during a time interval, the buck-boost circuit operates as the buck circuit, which is coupled to the battery; and wherein, during a subsequent time interval, the buck-boost circuit operates as the boost circuit, which is coupled to the battery.
 19. The electronic device of claim 18, further comprising a control logic configured to specify a duration of the time interval and a duration of the subsequent time interval based on the input voltage and the charging voltage.
 20. A method for charging a battery, comprising: receiving an input voltage from a power adapter; determining an operating mode of a buck-boost charging circuit based on the input voltage and a charging voltage of the battery, wherein the buck-boost charging circuit provides an output signal to charge the battery, and wherein, for a given input voltage and a given charging voltage, the buck-boost charging circuit operates in the operating mode in a group of modes, wherein the group of modes comprises: a buck mode, a boost mode and a buck-boost mode; and selecting the determined operating mode of the buck-boost charging circuit. 